package org.jeecg.modules.errorLog.service.impl;

import org.jeecg.modules.errorLog.entity.Error;
import org.jeecg.modules.errorLog.mapper.ErrorMapper;
import org.jeecg.modules.errorLog.service.IErrorService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * @Description: 错误日志
 * @Author: jeecg-boot
 * @Date:   2023-10-24
 * @Version: V1.0
 */
@Service
public class ErrorServiceImpl extends ServiceImpl<ErrorMapper, Error> implements IErrorService {

    @Override
    public void saveError() {
        saveError("");
    }

    @Override
    public void saveError(String message) {
        saveError(message, null);
    }

    @Override
    public void saveError(String message, String cause) {
        Error error = new Error();
        error.setMessage(message).setCause(cause);
        save(error);
    }
}
